package com.zh.oauth.entity;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.sql.Blob;
import java.util.Date;
import java.util.List;

@ApiModel("权限实体类")
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("elec_auth")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ElecAuth extends Model<ElecAuth> {

  private static final long serialVersionUID = -4596935469213956868L;

  @ApiModelProperty(value = "主键", name = "id")
  private Long id;
  @ApiModelProperty(value = "权限名", name = "authName")
  private String authName;
  @ApiModelProperty(value = "权限路径", name = "authPath")
  private String authPath;
  @ApiModelProperty(value = "上级id", name = "pid")
  private Long pid;
  @ApiModelProperty(value = "描述", name = "authDes")
  private String authDes;
  @ApiModelProperty(value = "创建日期", name = "authDate")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private Date authDate;
  @ApiModelProperty(value = "类型 1:前端, 2:后端", name = "authType")
  private Integer authType;
  @ApiModelProperty(value = "状态0:停用,1:正常,2:锁定", name = "authStatus")
  private Integer authStatus;
  @ApiModelProperty(value = "创建人姓名", name = "authOp")
  private String authOp;
  @ApiModelProperty(value = "是否为最后叶子节点1:true, 0:false", name = "isLeaf")
  private Integer isLeaf;
  @ApiModelProperty(value = "角色ID", name = "roleId")
  @TableField(exist = false)
  private Long roleId;
  @ApiModelProperty(value = "用户ID", name = "userId")
  @TableField(exist = false)
  private Long userId;
  @ApiModelProperty(value = "逻辑删除字段", name = "deleted")
  @TableLogic
  @TableField(select = false)
  private Integer deleted;
  @ApiModelProperty(value = "用于记录权限值删除时的详细信息", name = "des")
  @TableField(exist = false)
  private String des;
  @TableField(exist = false)
  private List<ElecAuth> children;

  public ElecAuth() { }
}
